package com.company.J1_2;

import java.util.Scanner;

public class Scanf {
    public static void main(String[] args) {
        Scanner scanner =new Scanner(System.in);
        System.out.print("请输入有多少学生:");
      int  scanerIndex=scanner.nextInt();
        System.out.println("请输入有多少门课程");
        int index =scanner.nextInt();
        double a[][]=new double[scanerIndex][index];
        double b[]=new double[scanerIndex];
        for (int i=0;i<scanerIndex;i++){
            for (int j=0;j<index;j++){
                System.out.print("请输入第"+(i+1)+"学生的第"+(j+1)+"门课程的成绩为:");
                a[i][j]=scanner.nextDouble();
            }
        }
        for (int i=0;i<scanerIndex;i++){
            double sum=0.0;
            for (int j=0;j<index;j++) {

                sum+=a[i][j];
            }
            System.out.println("第"+(i+1)+"学生的平均成绩为"+sum/scanerIndex*1.0);
            }
    }
}
